package com.ocom.common.enums;

public enum ApplyTypeEnum {

    //类型:1-事假;2-病假;3-年假;4-丧假;5-产假;

    leave("事假", 1),
    paymentCode("病假", 2),
    mainSweep("年假", 3),
    coupon("丧假", 4),
    order("产假", 5),
    cash("调休", 6)

   ;
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private ApplyTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }
    // 普通方法
    public static String getName(int index) {
        for (ApplyTypeEnum c : ApplyTypeEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
}
